

import UIKit
//enum MaskingType {
//    case Clear
//    case Connect
//}

class XWClearCacheView: UIView {
    private var container: UIView!
    
//    @IBOutlet weak var XWTitleLabel: UILabel!
    
//    private var isReconnection:Int = 0
//    private var providerManager:NETunnelProviderManager!
//    
//    private var tempModel:XWServerInfoModel?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        showUI()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
//    deinit{
//        NotificationCenter.default.removeObserver(self)
//    }
    
//    var type:MaskingType? {
//        didSet {
//            if type == .Clear{
//                XWTitleLabel.text = "Are you sure you want to be clear about caching data?"
//            }
//        }
//    }
//    var serverListModel:XWServerListModel?{
//        didSet{
//            
//        }
//    }
//    var XWTableView:UITableView?{
//        didSet{
//            
//        }
//    }
    
    @IBAction func XWCancelButtonClick(_ sender: UIButton) {
        self.removeFromSuperview()
    }
    
    @IBAction func XWConfirmButtonClik(_ sender: UIButton) {
//        if self.type == .Clear{
        currentViewController().showHint("Clear Successfully!")
        self.removeFromSuperview()
//        }else{
//            providerManager.connection.stopVPNTunnel()
//            DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
//                printLog("node_id："+(self.serverListModel?.node_id)!)
//                let parameters = ["data":["node_id":self.serverListModel?.node_id]]
//                XWHttpTool.init().getNodeInfo(parameters) { [self] model in
//                    self.tempModel = model
//                    startConnect(model.account_info!)
//                } failureHandler: { [self] failure in
//                    changeConnectState(false)
//                    currentViewController().showHint(failure)
//                    self.removeFromSuperview()
//                }
//            }
//            
//        }
//        
//        
    }
}
extension XWClearCacheView {
    private func showUI() {
        container = Bundle.main.loadNibNamed("XWClearCacheView", owner: self,options: nil)?.first as? UIView
        container.frame = bounds
        addSubview(container)
    }
}
